package com.cloudeye.bus.common;

import javax.validation.Valid;
import java.util.Objects;

/**
 * @author Ryan
 * @email liuwei412552703@163.com
 * @date 2021/1/4 9:23
 */
public class ReqPage<T> {

    private int current;

    private int size;


    @Valid
    private T data;

    public int getCurrent() {
        return current;
    }

    public void setCurrent(int current) {
        this.current = current;
    }

    public int getSize() {
        return size;
    }

    public void setSize(int size) {
        this.size = size;
    }

    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (!(o instanceof ReqPage)) {
            return false;
        }
        ReqPage<?> reqPage = (ReqPage<?>) o;
        return current == reqPage.current &&
                size == reqPage.size &&
                Objects.equals(data, reqPage.data);
    }

    @Override
    public int hashCode() {
        return Objects.hash(current, size, data);
    }

    @Override
    public String toString() {
        return "ReqPage{" +
                "current=" + current +
                ", size=" + size +
                ", data=" + data +
                '}';
    }
}
